<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateAkbusIncomeCardTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('akbus_income_card', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->date('date')->nullable()->comment('结算日期');
            $table->string('team')->nullable()->comment('车队');
            $table->tinyInteger('line')->nullable()->comment('线路');
            $table->string('license_plate_num')->nullable()->comment('车辆车牌号');
            $table->tinyInteger('card_type')->nullable()->comment('卡类型');
            $table->integer('charge_count')->nullable()->comment('扣款次数');
            $table->integer('free_count')->nullable()->comment('扣款次数');
            $table->integer('total_count')->nullable()->comment('扣款次数');
            $table->decimal('discount_before_amt', 10, 2)->nullable()->comment('优惠前金额');
            $table->decimal('discount_after_amt', 10, 2)->nullable()->comment('优惠前金额');
            $table->decimal('discount_amt', 10, 2)->nullable()->comment('优惠金额');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('akbus_income_card');
    }
}
